package com.yuji.aacar.controller.recharge;

import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;

import com.yuji.aacar.R;
import com.yuji.aacar.base.BaseActivity;
import com.yuji.aacar.base.EventConst;
import com.yuji.aacar.controller.about.AboutActivityVM;
import com.yuji.aacar.core.cores.event.CoreEventBusMessage;
import com.yuji.aacar.widgets.autolayout.AutoRelativeLayout;
import com.yuji.aacar.widgets.textview.PingFangTextView;
import com.yuji.aacar.wxapi.WXPayEntryActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * <li>Package:com.yuji.aacar.controller.about</li>
 * <li>Author: lining </li>
 * <li>Date: 2018/3/6</li>
 * <li>Description:   </li>
 */

public class RechargeActivity extends BaseActivity {

    @BindView(R.id.title_back)
    ImageView titleBack;
    @BindView(R.id.back_image)
    AutoRelativeLayout backImage;
    @BindView(R.id.title_content)
    PingFangTextView titleContent;
    @BindView(R.id.back_login)
    PingFangTextView backLogin;
    @BindView(R.id.title_message_iv)
    ImageView titleMessageIv;
    @BindView(R.id.title_message_rl)
    AutoRelativeLayout titleMessageRl;
    @BindView(R.id.title_rl)
    AutoRelativeLayout titleRl;
    @BindView(R.id.recharge_but_btn)
    Button rechargeButBtn;
    private AboutActivityVM aboutActivityVM;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_recharge);
        ButterKnife.bind(this);
        initTitle(true, "充值积分", null);
        super.onCreate(savedInstanceState);
    }

    @OnClick(R.id.recharge_but_btn)
    public void onClick() {
        presentController(WXPayEntryActivity.class,getIntent().putExtra("jifenpay", true));
    }

    @Override
    public void handleMessage(CoreEventBusMessage message) {
        super.handleMessage(message);
        if (message.getMessageCode().contentEquals(String.valueOf(EventConst.PAY_JIFEN_FINISH))) {
            finish();
        }
    }
}
